<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once 'excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("goji.xls");
?>
<html>
<head>
<style>
table.excel {
	border-style:ridge;
	border-width:1;
	border-collapse:collapse;
	font-family:sans-serif;
	font-size:12px;
}
table.excel thead th, table.excel tbody th {
	background:#CCCCCC;
	border-style:ridge;
	border-width:1;
	text-align: center;
	vertical-align:bottom;
}
table.excel tbody th {
	text-align:center;
	width:20px;
}
table.excel tbody td {
	vertical-align:bottom;
}
table.excel tbody td {
    padding: 0 3px;
	border: 1px solid #EEEEEE;
}
</style>
</head>

<body>
<?php 

//echo $data->dump(true,true); 
//var_dump($data->sst);


//var_dump($data);
$sheets = $data->sheets;
$items = $sheets[0]['cells'];
//var_dump($sheets[0]['cells']);

$names = array();
foreach ($items as $item){
	if(trim(strtolower($item[1])) == 'staff no.') {
		$names[] = array('id'=>$item[2],'name'=>$item[5]);
	} else {
		continue;
	}
		

	/*
	foreach($item as $it){
		if($it=="") $it =" - ";
		echo "$it \t";
	}
	*/
	
}

var_dump($names);




/*$i=0;
foreach ($data->sst as $d){
	$m = preg_match_all('/[0-9]{8}/', $d, $match); 
	if($m){
		//var_dump($match);
		$i++;
		echo "<br>$i: ";
	}
	
	echo "$d \t";
}*/
//var_dump($data->numRows);
//var_dump($data);
?>
</body>
</html>
